<template>
    <el-container>
        <el-header class="w">
            <div class="left">
                <img src="@/assets/img/logo.png" alt="" width="200" />
                <span>欢迎登录</span>
            </div>
            <div class="right">
                <div>如有问题请拨打</div>
                <div>40000-1000-25</div>
            </div>
        </el-header>
        <!-- 登录表单区域 -->
        <el-main>
            <div class="w mask">
                <el-form class="login" :model="user" label-width="80px" :inline="false" @submit.native.prevent="loginMethod">
                    <div class="desc">
                        <div>供应商登录</div>
                        <div>
                            <span><router-link to="/singin">找回密码</router-link></span>
                            <span><router-link to="/singin">立即注册</router-link></span>
                        </div>
                    </div>

                    <el-input
                        class="input-border-style"
                        v-model="user.user"
                        placeholder="请输入邮箱"
                        :prefix-icon="Message"
                    />

                    <el-input
                        class="input-border-style"
                        type="password"
                        v-model="user.password"
                        placeholder="请输入密码"
                        :prefix-icon="Lock"
                        style="letter-spacing: 10px"
                        show-password
                    />
                    <el-button native-type="submit">登录</el-button>
                </el-form>

                <img src="@/assets/img/undraw_scientist_ft0o.svg" alt="" />
            </div>
        </el-main>
        <el-footer>
            <a rel="nofollow" target="_blank" href="#">关于我们</a>
            /
            <a rel="nofollow" target="_blank" href="#">联系我们</a>
            /
            <a rel="nofollow" target="_blank" href="#">人才招聘</a>
            /
            <a rel="nofollow" target="_blank" href="#">商家入驻</a>
            /
            <a rel="nofollow" target="_blank" href="#">广告服务</a>
            /
            <a rel="nofollow" target="_blank" href="#">销售联盟</a>
            /
            <a rel="nofollow" target="_blank" href="#">友情链接</a>
            /
            <a rel="nofollow" target="_blank" href="#">在线客服</a>
        </el-footer>
    </el-container>
</template>

<script setup>
import { Lock, Message } from '@element-plus/icons-vue';
import { reactive } from 'vue';
import { userStore, categoryStore } from '@/store/index';
const user = reactive({
    user: '',
    password: '',
});

// 登录方法
function loginMethod() {
    userStore.login(user)
    categoryStore.getCateList();
}
// 控制台打印js对象
</script>

<style scoped lang="scss">
.el-header {
    height: 130px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    .left {
        display: flex;
        align-items: center;
    }
    .right {
        display: flex;
        flex-direction: column;
        justify-content: center;
        div:first-child {
            font-size: 16px;
        }
        div:last-child {
            font-size: 28px;
            color: #1f528a;
        }
    }
}
.el-main {
    padding: 0;
    width: 100%;
    height: 560px;
    background-color: #1963b1;

    .mask {
        height: 100%;
        display: flex;
        justify-content: space-around;
        align-items: center;
        background: rgba(255, 255, 255, 0.4);
    }
    .mask > img {
        width: 50%;
        height: 65%;
    }
}

// 登录表单
.login {
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 5%;
    margin-top: -8%;

    .desc {
        div {
            margin-bottom: 10px;
            color: #000000;
        }
        div:first-child {
            font-size: 24px;
        }
        div:last-child {
            font-size: 14px;
            display: flex;
            justify-content: space-between;
        }
    }
    .input-border-style {
        height: 40px;
        width: 100%;
        margin-bottom: 10px;
    }
}
.el-footer {
    height: auto;
    text-align: center;
    padding: 20px 0;
    a {
        margin: 0 10px;
        text-decoration: none;
        color: #000000;
        font-size: 16px;
        font-weight: 500;
        &:hover {
            color: #225a96;
        }
    }
}
</style>
